package com.abc.robot01.activity

import android.os.Bundle
import android.util.Log
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.ui.Modifier
import androidx.lifecycle.lifecycleScope
import com.abc.robot01.R
import com.abc.robot01.retrofit.RetrofitService
import com.abc.robot01.vivemodel.Robot
import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi
import com.bumptech.glide.integration.compose.GlideImage
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

/**
 * 唤醒页
 */
class Init : AppCompatActivity() {
    @OptIn(ExperimentalGlideComposeApi::class)
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        lifecycleScope.launch {
            RetrofitService.instance.wakeUpConfig(Robot.companyId).string().also {
                Log.e(TAG,""+it)
            }

            delay(0)
//            delay(3000)
            startActivity<BaseActivity>()
        }

        setContent {
            MaterialTheme {
                GlideImage(
                    model = R.drawable.z1,
                    contentDescription = "",
                    modifier = Modifier.fillMaxSize()
                )
            }
        }
        }

    override fun onPause() {
        super.onPause()
    }

    override fun onResume() {
        super.onResume()
    }

    companion object {
        const val TAG = "唤醒页"
    }
}

